package com.mars.admin.modules.activity.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mars.admin.framework.listener.EntityChangeListener;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 代码领取微信公众号【程序员Mars】
 *
 * @className: ActivityCategory
 * @author: Mars
 * @date: 2025/7/28 22:46
 */

@Data
@Accessors(chain = true)
@Table(value = "tb_tag", onInsert = EntityChangeListener.class, onUpdate = EntityChangeListener.class)
@Schema(description = "活动标签")
public class ActivityTag {


    private static final long serialVersionUID = 1L;

    @Id(keyType = KeyType.Auto)
    @Schema(description = "ID")
    private Long id;


    @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @Column("name")
    private String name;

    @Schema(description = "color", requiredMode = Schema.RequiredMode.REQUIRED)
    @Column("color")
    private String color;

    @Schema(description = "icon", requiredMode = Schema.RequiredMode.REQUIRED)
    @Column("icon")
    private String icon;

    @Column("description")
    @Schema(description = "描述")
    private String description;


    @Column("category")
    @Schema(description = "分类")
    private String category;


    @Column("use_count")
    @Schema(description = "使用数量")
    private Integer useCount;

    @Column("sort_order")
    @Schema(description = "排序")
    private Integer sortOrder;


    @Column("is_hot")
    @Schema(description = "是否热门：0-否，1-是")
    private Integer isHot;


    @Column("status")
    @Schema(description = "状态：0-禁用，1-启用")
    private Integer status;


    @Schema(description = "创建时间", example = "2024-01-01 12:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(onInsertValue = "now()")
    private LocalDateTime createTime;


    @Schema(description = "更新时间", example = "2024-01-01 12:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(onInsertValue = "now()", onUpdateValue = "now()")
    private LocalDateTime updateTime;

}
